package com.ww;

import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ww.utils.HttpClientUtils;
import com.ww.utils.MD5Util;

/**
 * Hello world!
 *
 */
public class App {
	
	static Logger logger = LoggerFactory.getLogger(App.class);
	
	public static void main(String[] args) throws URISyntaxException, UnsupportedEncodingException {
		/* List<String> list1 = FileUtils.readTxtByLine("/Users/wangwei/soft/jx1", "UTF-8");
		List<String> list2 = FileUtils.readTxtByLine("/Users/wangwei/soft/jx2", "UTF-8");
		
		List<String> diffList = CompareUtils.diffStrInList1(list1, list2);
		System.out.println(diffList);
		
		Map<String, Integer> sameCount1 = CompareUtils.countSameStr(list1);
		System.out.println("list1 > "+ sameCount1);
		
		Map<String, Integer> sameCount2 = CompareUtils.countSameStr(list2);
		System.out.println("list2 > "+ sameCount2);
		*/
		
		Map<String, Object> paramsMap = new HashMap<>();
		paramsMap.put("username", "13797039695");
		paramsMap.put("encryPassword", "111111");
		
		String rs = HttpClientUtils.httpPostRequest("http://localhost:8080/bbs/api/user/update", paramsMap);
		
//		String rs = HttpClientUtils.httpGetRequest("http://localhost:8080/bbs/api/v2/domains?p=1");
		System.out.println(rs);
		
		
//		String xml = "<PWBRequest>"
//				+ "<transactionName>SEND_CODE_REQ</transactionName>"
//				+ "<header>"
//				+ "<application>SendCode</application>"
//				+ "<requestTime>2017-04-28 16:41:14</requestTime>"
//				+ "</header>"
//				+ "<identityInfo>"
//				+ "<corpCode>TESTFX</corpCode>"
//				+ "<userName>admin</userName>"
//				+ "</identityInfo>"
//				+ "<orderRequest>"
//				+ "<order>"
//				+ "<certificateNo></certificateNo>"  
//				+ "<linkName>测试11</linkName>"
//				+ "<linkMobile>13888888888</linkMobile>"
//				+ "<orderCode>123123</orderCode>"
//				+ "<orderPrice>45</orderPrice>"
//				+ "<payMethod>vm</payMethod>"
//				+ "<ticketOrders><ticketOrder>"
//				+ "<orderCode>123123</orderCode>"
//				+ "<totalPrice>20</totalPrice>"
//				+ "<quantity>1</quantity>"
//				+ "<occDate>2017-06-20 00:00:00</occDate>"
//				+ "<goodsCode>PST20160918013085</goodsCode>"
//				+ "</ticketOrder></ticketOrders>"
//				+ "</order>"
//				+ "</orderRequest>"
//				+ "</PWBRequest>";
//		
//		String sign = MD5Util.getMD5("xmlMsg="+xml+"TESTFX").toLowerCase();
//		System.out.println(sign);
//		
//		Map<String, Object> paramsMap = new HashMap<>();
//		paramsMap.put("xmlMsg", xml);
//		paramsMap.put("sign", sign);
//		
//		String rs = HttpClientUtils.httpPostRequest("http://ds-zff.sendinfo.com.cn/boss/service/code.htm", paramsMap);
//		System.out.println(rs);
	}
	
}



